import React from 'react'
import { useSelector } from 'react-redux'

function index() {
    const arr = useSelector((state:any) => state.student.componentList);
    const key = useSelector((state:any) => state.student.currentKey)
  return (
    <div className='chicun'>
        <p>尺寸</p>
        <div>
            <div>
                <input type="text" value={(arr.length && key !== null) ? arr[key].style.width : ''}/>
                <input type="text" value={(arr.length && key !== null) ? arr[key].style.height : ''}/>
            </div>
            <div>
                <span>宽</span>
                <span>高</span>
            </div>
        </div>
            <p>位置</p>
            <div>
                <div>
                    <input type="text" value={(arr.length && key !== null) ? arr[key].style.left : ''}/>
                    <input type="text" value={(arr.length && key !=null) ? arr[key].style.top : ''}/>
                </div>
                <div>
                    <span>X</span>
                    <span>Y</span>
                </div>
            </div>
    </div>
  )
}

export default index